<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>推广客户</title>
    <!-- 制定规则 -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- ICON 设置-->
    <link rel="shortcut icon" href="/Extend/images/logo/web-logo.png">
    <!-- CSS -->
    <link href="/Extend/global-style.css" rel="stylesheet">
    <!-- JS -->
    <script src="/Extend/jquery-3.3.1.js" type="text/javascript"></script>
    <style type="text/css">
        body{
            background: #f5f5f5;
        }
        .user-container{
            width: 100%;
            height: auto;
            display: flex;
            flex-direction: column;
            position: relative;
        }
        .top{
            width: 100%;
            height: 75px;
            background: url("/Extend/images/search-bg.png")no-repeat center center;
            background-size: cover;
            text-align: center;
        }
        .key-search{
            display: inline-block;
            margin-top: 15px;
        }
        .bottom{
            width: 96%;
            position: relative;
            top: -15px;
           background: #fff;
            box-shadow: 0px 0px 15px rgba(0,0,0,0.2);
            border-radius: 6px 6px 0 0;
            min-height: 1250px;
            margin: 0 auto;
            text-align: center;
        }
        .bottom-tit{
            width: 100%;
            height: 40px;
            line-height: 40px;
            font-size: 14px;
            box-sizing: border-box;
            background: #f5f5f5;
            padding: 0px 10px;
        }
        .sel-building{
            border: 1px solid #e5e5e5;
            border-radius: 2px;
            height: 26px;
            line-height: 26px;
            font-size: 12px;
            margin-top: 7px;
        }
        .bottom-user{
            clear: both;
            padding: 0 10px;
            box-sizing: border-box;
        }
        .bottom-user>li{
            text-align: left;
            font-size: 14px;
            color: #666;
            line-height: 30px;
            padding: 15px 0;
            border-bottom: 1px solid #e5e5e5;
        }
        /*表格为空*/
        .empty-img{
            display: block;
            margin: 0 auto;
            margin-bottom: 7px;
            margin-top: 40px;
            width: 60px;
        }
        .empty-font{
            width: 100%;
            font-size: 14px;
            color: #999;
            letter-spacing: 1px;
            text-align: center;
        }
        .empty-font>a{
            text-decoration: underline;
            color: #A92E39!important;
        }
    </style>
</head>
<body style="max-width: 500px;margin: 0 auto">
    <form name="myForm" action="" method="get">
        <input type="hidden" name="key" id="key" value="{$searchData.key}">
        <input type="hidden" name="building" id="building" value="{$searchData.building}">
        <input type="hidden" name="mark" id="mark" value="{$searchData.mark}">
    </form>
    <div class="user-container">
        <div class="top">
            <div class="key-search">
                {include file="../../extend/Template-keySearch"/}
            </div>
        </div>
        <div class="bottom">
            <div class="bottom-tit">
                <div class="fl">系统已有 {$infoNum} 个客户</div>
                <select class="fr sel-building">
                    <option value="" {eq name="$searchData.building" value="" } selected {/eq}>请选择意向楼盘</option>
                    {volist name='building' id='building1'}
                    <option value="{$building1}" {eq name="$searchData.building" value="$building1" } selected {/eq}>{$building1}</option>
                    {/volist}
                </select>
            </div>
            <div class="bottom-users">
                <ul class="bottom-user">
                    {volist name='info' id='info1'}
                    <li data-id="{$info1.id}">
                        <div>客户姓名：{$info1.name}</div>
                        <div>客户电话：{$info1.telephone}</div>
                        <div>意向楼盘：{$info1.building}</div>
                        {if condition="$info1.origin neq ''"}
                        <div>搜索来源：{$info1.origin}</div>
                        {/if}
                        {if condition="$info1.words neq ''"}
                        <div>搜索关键词：{$info1.words}</div>
                        {/if}
                        <div>进入时间：{$info1.date|showDate}</div>
                    </li>
                    {/volist}
                </ul>
            </div>
        </div>
    </div>
</body>
<script>
    $(function(){
        $(".sel-building").change(function(){
            var building=$(this).val();
            console.log(building)
            $("#building").val(building);
            myForm.submit();
        })
        var window_url= window.location.pathname;
        //表格没有内容时。。。
        var len=$('.bottom-user li').length
        var keys=$("#key").val();
        var building=$("#building").val();
        var mark=$("#mark").val();
        console.log(len,keys,building)
        if(len<=0 && (keys!=='' || building !=='') ){
            $('.bottom-users').empty().append(
                '<img class="empty-img" src="/Extend/images/operation-icon/empty.svg" alt="暂无数据" title="暂无数据">'+
                '<p class="empty-font">暂时没有相关数据<a href = "https://fang.enterlo.com/index/index/NMXVU19G0E?mark='+mark+'">查看全部</a></p>'
            )
        }else if(len<=0 && keys=='' && building==''){
            $('.bottom-users').empty().append(
                "<img class='empty-img' src='/Extend/images/operation-icon/empty.svg' alt='暂无数据' title='暂无数据'>"+
                "<p class='empty-font'>暂时没有相关数据</p>"
            )
        }
    })
</script>
</html>